/**
 * @author jiangwei
 * @since 19/2/20
 */
public class MySingleton {
    private MySingleton(){}
    private static volatile MySingleton mySingleton = null;

    public static MySingleton getMySingleton(){
        if(mySingleton == null){
            synchronized(MySingleton.class){
                if (mySingleton == null) {
                    mySingleton = new MySingleton();
                }
            }
        }

        return mySingleton;
    }
}
